Skip to content

Conversation

@ssd04
Copy link
Contributor

@ssd04 ssd04 commented Oct 25, 2024

Reasoning behind the pull request

  • This PR implements a comprehensive state accesses collection system for tracking state changes during transaction execution. The purpose is to capture and optionally persist detailed information about state reads and writes, including account modifications and data trie changes.

Proposed changes

  • Add StateAccessesCollector interface and implementations for collecting state accesses during transaction processing
  • Add --state-accesses-types-to-collect flag to enable collecting specified state accesses types. Can be (READ, WRITE). This can also be set in the config.
[StateAccessesCollectorConfig]
    TypesToCollect = []          # These can be "READ","WRITE".
    SaveToStorage = false
    WithAccountChanges = false

If SaveToStorage is set to true, the state changes will be saved in a db.
If WithAccountChanges is set to true, the collected state accesses will also collect what fields changed in the account

  • If outport driver is enabled, the state accesses will also be exported there
  • The state accesses structure that is exported is map[string]*stateChange.StateAccesses, where string represents the txHash and *stateChange.StateAccesses is defined as
type StateAccesses struct {
	StateAccess []*StateAccess `protobuf:"bytes,1,rep,name=StateAccess,proto3" json:"stateAccess"`
}

Testing procedure

  • Collect state accesses from the outport driver. Create a testing tool that will start from the same state. By applying all the collected state accesses, the resulting root hash should be the same as a full node that processed all of the transactions

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

BeniaminDrasovean and others added 30 commits September 8, 2023 17:34
…t-client-support

Merge rc/v1.7.0 in feat/light client support
…llector

# Conflicts:
#	epochStart/metachain/systemSCs_test.go
#	factory/api/apiResolverFactory.go
#	factory/processing/blockProcessorCreator_test.go
#	factory/state/stateComponents.go
#	genesis/process/memoryComponents.go
#	integrationTests/state/stateTrie/stateTrie_test.go
#	integrationTests/testInitializer.go
#	process/transaction/metaProcess.go
#	state/accountsDB.go
#	state/accountsDB_test.go
#	state/errors.go
#	state/factory/accountsAdapterAPICreator_test.go
#	state/interface.go
#	state/storagePruningManager/storagePruningManager_test.go
#	state/trackableDataTrie/trackableDataTrie.go
#	state/trackableDataTrie/trackableDataTrie_test.go
#	testscommon/integrationtests/factory.go
#	testscommon/state/accountsAdapterStub.go
#	update/genesis/import.go
…-client-support

Merge rc/1.7.0 in feat/light client support
# Conflicts:
#	cmd/node/config/config.toml
#	state/accountsDB_test.go
#	state/errors.go
#	state/interface.go
#	state/trackableDataTrie/trackableDataTrie.go
export original key and val in dataTrieChanges
@github-actions
Copy link

Integration Tests completed with failures or errors.

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: 6db9b0799726660606da22cc59b017ac5c50065d
  • Current Branch: feat/state-changes
  • mx-chain-go Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Target Branch: rc/barnard-patch-3
  • mx-chain-testing-suite Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Commit Hash: 6fda63035fc14f63a7684086b87c16f3e30f79b0

🚀 Environment Variables:

  • TIMESTAMP: 2025_SEPTEMBER_29__07_38_32
  • PYTEST_EXIT_CODE: 1

danidrasovean
danidrasovean previously approved these changes Oct 8, 2025
sstanculeanu
sstanculeanu previously approved these changes Oct 8, 2025
@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Integration Tests completed with failures or errors.

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: 5ee992d1541cf48117a360efc681552b0d9bf1c0
  • Current Branch: feat/state-changes
  • mx-chain-go Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Target Branch: rc/barnard-patch-3
  • mx-chain-testing-suite Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Commit Hash: 6fda63035fc14f63a7684086b87c16f3e30f79b0

🚀 Environment Variables:

  • TIMESTAMP: 2025_OCTOBER_08__07_57_32
  • PYTEST_EXIT_CODE: 1

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Integration Tests completed with failures or errors.

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: cf5a0ae7130655c6be55cfde81be4d5f5f26b27f
  • Current Branch: feat/state-changes
  • mx-chain-go Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Target Branch: rc/barnard-patch-3
  • mx-chain-testing-suite Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Commit Hash: 6fda63035fc14f63a7684086b87c16f3e30f79b0

🚀 Environment Variables:

  • TIMESTAMP: 2025_OCTOBER_08__08_38_15
  • PYTEST_EXIT_CODE: ``

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Integration Tests completed with failures or errors.

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: cf5a0ae7130655c6be55cfde81be4d5f5f26b27f
  • Current Branch: feat/state-changes
  • mx-chain-go Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Target Branch: rc/barnard-patch-3
  • mx-chain-testing-suite Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Commit Hash: 6fda63035fc14f63a7684086b87c16f3e30f79b0

🚀 Environment Variables:

  • TIMESTAMP: 2025_OCTOBER_08__10_23_58
  • PYTEST_EXIT_CODE: ``

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Integration Tests completed with failures or errors.

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: 7d08af0864168b46836fb5710292bed97b8a94b8
  • Current Branch: feat/state-changes
  • mx-chain-go Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Target Branch: rc/barnard-patch-3
  • mx-chain-testing-suite Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Commit Hash: 6fda63035fc14f63a7684086b87c16f3e30f79b0

🚀 Environment Variables:

  • TIMESTAMP: 2025_OCTOBER_08__11_26_16
  • PYTEST_EXIT_CODE: ``

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

Integration Tests completed with failures or errors.

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: 7d08af0864168b46836fb5710292bed97b8a94b8
  • Current Branch: feat/state-changes
  • mx-chain-go Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Target Branch: rc/barnard-patch-3
  • mx-chain-testing-suite Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Commit Hash: 6fda63035fc14f63a7684086b87c16f3e30f79b0

🚀 Environment Variables:

  • TIMESTAMP: 2025_OCTOBER_08__12_12_43
  • PYTEST_EXIT_CODE: 1

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Integration Tests completed with failures or errors.

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: 7d08af0864168b46836fb5710292bed97b8a94b8
  • Current Branch: feat/state-changes
  • mx-chain-go Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Target Branch: rc/barnard-patch-3
  • mx-chain-testing-suite Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Commit Hash: 1e83241b6262cd09b5355f5bcf8c8a8b4e1408cf

🚀 Environment Variables:

  • TIMESTAMP: 2025_OCTOBER_09__09_59_04
  • PYTEST_EXIT_CODE: 1

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Integration Tests passed successfully!

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: 7d08af0864168b46836fb5710292bed97b8a94b8
  • Current Branch: feat/state-changes
  • mx-chain-go Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Target Branch: rc/barnard-patch-3
  • mx-chain-testing-suite Target Branch: rc/barnard-patch-3
  • mx-chain-simulator-go Commit Hash: 1e83241b6262cd09b5355f5bcf8c8a8b4e1408cf

🚀 Environment Variables:

  • TIMESTAMP: 2025_OCTOBER_09__13_16_55
  • PYTEST_EXIT_CODE: 0

@BeniaminDrasovean BeniaminDrasovean merged commit 38974a2 into rc/barnard-patch-3 Oct 9, 2025
14 of 17 checks passed
@BeniaminDrasovean BeniaminDrasovean deleted the feat/state-changes branch October 9, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants